prefix=@prefix@
all:
	cd server; make
	cd client; make
	cd unicon; make
	cd ImmModules/cce && make
	cd ImmModules/cxterm && make
	cd ImmModules/turbo && make
ccedata:
	cd ImmModules/cce/inputs && make
gbdata:
	cd ImmModules/turbo; make gbdata
big5data:
	cd ImmModules/turbo; make big5data

data: gbdata big5data ccedata 

data-install:
	if [ ! -d $(prefix) ] ; then mkdir -p $(prefix); fi
	if [ ! -d $(prefix)/lib/unicon ] ; then mkdir -p $(prefix)/lib/unicon; fi
	if [ ! -d $(prefix)/bin ] ; then mkdir -p $(prefix)/bin; fi
	cd ImmModules/cce/inputs; make install
	cd ImmModules/turbo; make data-install
install: all
	if [ ! -d $(prefix) ] ; then mkdir -p $(prefix); fi
	if [ ! -d $(prefix)/lib/unicon ] ; then mkdir -p $(prefix)/lib/unicon; fi
	if [ ! -d $(prefix)/bin ] ; then mkdir -p $(prefix)/bin; fi
	cd server; make install
	cd client; make install
	cd unicon; make install
	cd ImmModules/cce; make install
	cd ImmModules/cxterm; make install
	cd ImmModules/turbo; make install

clean:
	cd server; make clean
	cd client; make clean
	cd unicon; make clean
	cd ImmModules/cce; make clean
	cd ImmModules/cce/inputs; make clean
	cd ImmModules/cxterm; make clean
	cd ImmModules/cxterm/dict; make clean
	cd ImmModules/cxterm/utils; make clean
	cd ImmModules/turbo; make clean
	rm -f *.bak core a.out *~ 

distclean: clean
	rm -f config.status config.log config.cache Makefile tags TAGS
	cd server; make distclean
	cd unicon; make distclean
	cd client; make distclean
	cd ImmModules/cce; make distclean
	cd ImmModules/cce/inputs; make distclean
	cd ImmModules/cxterm; make distclean
	cd ImmModules/turbo; make distclean

